//
//  UIView+Additions.swift
//  live
//
//  Created by leo on 16/7/5.
//  Copyright © 2016年 io.ltebean. All rights reserved.
//

import UIKit
import RxSwift

extension UIView {
    
    private struct AssociatedKeys {    
        static var color = "UIView_Additions_borderColor_associatedKey"
    }
    
    @IBInspectable var borderColor: UIColor? {
        set {
            objc_setAssociatedObject(self, &AssociatedKeys.color, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
            layer.borderColor = borderColor?.cgColor
        }
        get {
            return objc_getAssociatedObject(self, &AssociatedKeys.color) as? UIColor
        }
    }
}
